$value) { // and print out the values //echo $value ; $rg = $_SESSION['regchk'][$value] ; //echo '
'; $ins = $DBcon->prepare("insert into plis(reg) values('$rg')") ; $ins->execute() ; } //get alpha grades //if(!isset($_SESSION['ok'])) header("location: printsr.php") ; $af = 'Alpha / Distinction' ; $alpha = $DBcon->prepare("select * from average where grades = :a ") ; $alpha->bindparam(':a', $af) ; $alpha->execute() ; if($alpha->rowcount() > 0) { $rowds = $alpha->FETCH(PDO::FETCH_ASSOC) ; $as = $rowds['start'] ; $ae = $rowds['end'] ; } //get credits grade $cd = 'Credit' ; $crd = $DBcon->prepare( "select * from average where grades = :c ") ; $crd->bindparam(':c', $cd) ; $crd->execute() ; if($crd->rowcount() > 0) { $rowcr = $crd->FETCH(PDO::FETCH_ASSOC) ; $cs = $rowcr['start'] ; $ce = $rowcr['end'] ; } //get pass grade $p = 'Pass' ; $pass = $DBcon->prepare("select * from average where grades = :p ") ; $pass->bindparam(':p' , $p) ; $pass->execute() ; if($pass->rowcount() > 0) { $rowps = $pass->FETCH(PDO::FETCH_ASSOC) ; $ps = $rowps['start'] ; $pe = $rowps['end'] ; } //get failure grades $f = 'Fail' ; $fail =$DBcon->prepare("select * from average where grades =:f ") ; $fail->bindparam(':f' , $f) ; $fail->execute() ; if($fail->rowcount() > 0) { $rowfl = $fail->FETCH(PDO::FETCH_ASSOC) ; $fs = $rowfl['start'] ; $fe = $rowfl['end'] ; } //get promotional average $pa = 'Promotion Average' ; $pro = $DBcon->prepare("select * from average where grades = :pr "); $pro->bindparam(':pr' , $pa) ; $pro->execute() ; if($pro->rowcount() > 0) { $rowpro = $pro->FETCH(PDO::FETCH_ASSOC) ; $prs = $rowpro['start'] ; $pre = $rowpro['end'] ; } */ } function generateTeacherComment($average) { if ($average >= 80) { $comment = "Excellent performance! Shows exceptional understanding of all subjects. Keep it up!"; } elseif ($average >= 70) { $comment = "Very good performance. Shows strong grasp of most concepts. Continue the good work."; } elseif ($average >= 60) { $comment = "Good performance. Shows satisfactory understanding. Room for improvement in some areas."; } elseif ($average >= 50) { $comment = "Average performance. Needs to work harder and be more consistent in studies."; } elseif ($average >= 40) { $comment = "Below average. Requires extra help and regular practice to improve."; } else { $comment = "Unsatisfactory performance. Immediate intervention required. Extra classes recommended."; } return $comment; } //end.... //VARIABLES //$pin = $_SESSION['pin'] ; $classid = $_SESSION['class'] ; $schyear = $_SESSION['yr'] ; $term = $_SESSION['tm'] ; //$regno = $_SESSION["rgno"] ; // $classtotal = $_SESSION["classnumc"] ; //$level = substr($classid, 0, 4); //$level1 = substr($classid, 0, 5); $myArr = array(); $array_regno = array() ; //get student name from students table //GET NUMBER IN CLASS IN THIRD TERM $sqlpoc = $DBcon->prepare(" select distinct regno from marks where (term =:tm and acyear = :yr ) and klass= :kls " ); $sqlpoc->bindparam(':tm' , $term) ; $sqlpoc->bindparam(':yr' , $schyear) ; $sqlpoc->bindparam(':kls' , $classid) ; $sqlpoc->execute() ; $numbt = $sqlpoc->rowcount() ; while($row_reg = $sqlpoc->fetch(pdo::FETCH_ASSOC)) { $rg = $row_reg['regno'] ; $array_regno[] = $rg ; //echo $rg ; } //$_SESSION["classnumt"] = $numbt ; //END //get minimum no of subject /* $level = getm($classid) ; $sqlm = $DBcon->prepare("select * from subjno where (classlevel = :kls and term = :tm) and yr = :y ") ; $sqlm->bindparam(':kls' , $level) ; $sqlm->bindparam(':tm' , $term) ; $sqlm->bindparam(':y',$schyear) ; $sqlm->execute() ; $rowm = $sqlm->FETCH(PDO::FETCH_ASSOC) ; $min = $rowm['nos'] ; //end.... */ //get next term fees and resumption /* $sqlt = $DBcon->prepare("select * from next" ) ; //$sqlname->bindparam(':reg' , $regno) ; $sqlt->execute() ; if ($sqlt->rowcount() > 0) { $rowat = $sqlt->FETCH(PDO::FETCH_ASSOC) ; $nxtf = $rowat['fees'] ; $nxtr = $rowat['resume'] ; } */ ?> prepare("select * from plis") ; //$getlist->execute() ; foreach ($array_regno as $rg) { $myArr = array() ; $subjp = array() ; $maya = array() ; $myarray = array() ; $arresult = array() ; $regno = $rg ; $rlist[] = $regno ; $streamno1 = array(); $arresult1 = array() ; $myarray1 = array() ; $maya1 = array() ; $myArr1 = array() ; $psubj = array() ; $pscore = array() ; $sqlname = $DBcon->prepare("select * from students_info where regno = :reg " ) ; $sqlname->bindparam(':reg' , $regno) ; $sqlname->execute() ; if ($sqlname->rowcount() > 0) { $rowa = $sqlname->FETCH(PDO::FETCH_ASSOC) ; $names = $rowa['fullname'] ; } ?> result sheet

Term Class
Student Image
Name : prepare("select * from students_info where regno = '$regno'") ; $getname->execute() ; $rowx = $getname->fetch(pdo::FETCH_ASSOC) ; $stname = $rowx['fullname'] ; echo $stname ; ?> House  
Reg. No Session

prepare("select * from marks where ( (regno = :reg and acyear = :yr) and (term = :tm and klass = :kls) ) ") ; $sql->bindparam(':reg',$regno) ; $sql->bindparam(':yr',$schyear) ; $sql->bindparam(':tm',$term) ; $sql->bindparam(':kls',$classid) ; $sql->execute() ; $num_rows = $sql->rowcount() ; while ($row = $sql->FETCH(PDO::FETCH_ASSOC)) { $sbjid = $row['subject_id'] ; $sqlsbj = $DBcon->prepare("select subject_id, subjectname from subjectss where subject_id = :id") ; $sqlsbj->bindparam(':id',$sbjid ) ; $sqlsbj->execute() ; //$getsubj = mysql_query($sqlsbj) ; $rowsub = $sqlsbj->FETCH(PDO::FETCH_ASSOC) ; $mysubj = $rowsub['subjectname'] ; $asses1 = $row['test'] ; // $asses2 = $row['midterm']; $exam = $row['exam'] ; //$subj = $row['subject'] ; $total = $asses1 + $exam ; $myArr[] = $total; // $psubj[] = $mysubj ; $pscore[] = $total ; //} //$totalscore = $initial + $total ; if ($total <= 48.99) { $grade = 'F' ; $rmk = 'FAIL' ; } elseif( ($total >= 49.00) && ($total <= 54.99) ) { $grade = 'P' ; $rmk= 'PASS' ; } elseif( ($total >= 55.00) && ($total <= 69.99) ) { $grade = 'C' ; $rmk = 'CREDIT' ; } elseif( ($total >= 70) && ($total <= 74.00) ) { $grade = 'B' ; $rmk = 'V.Good' ; } elseif( ($total >= 75) && ($total <= 100) ) { $grade = 'A' ; $rmk = 'DISTINCTION' ; } else $grade = '' ; //remarks if( ($total >= 80) && ($total <= 100) ) { $remarks = 'Excellent' ; } elseif( ($total >= 70) && ($total <= 79.99) ) { $remarks = 'V.Good' ; } elseif( ($total >= 50) && ($total <= 69.99) ) { $remarks = 'Good' ; } elseif( ($total >= 40) && ($total <= 49.99) ) { $remarks = 'Fair' ; } elseif( ($total <= 39.99) ) { $remarks = 'Poor' ; } echo ""; echo ""; echo ""; // echo ""; echo ""; echo ""; //begin subject position $subj = $row['subject_id'] ; $subjp = array() ; $pst = $DBcon->prepare("select subject_id, test, exam from marks where (term = '$term' and acyear= '$schyear') and (klass = '$classid' and subject_id = $subj)") ; $pst->execute() ; while($rw = $pst->fetch(pdo::FETCH_ASSOC)) { $tc = $rw['test'] ; // $md = $rw['midterm'] ; $te = $rw['exam'] ; $tt = $tc + $te ; $subjp[] = $tt ; } arsort($subjp) ; $psm = 0 ; foreach($subjp as $totm) { $psm++ ; $appm = position($psm) ; if($total == $totm) { $spm = $psm.$appm ; //echo $ps.$app ; break ; } } echo ""; echo ""; echo ""; echo "" ; //echo ""; } $count = 0 ; foreach ($myArr as $value) { $count += $value ; //$count = $count + $value ; } //get minimum no of Subject /* $sqlm = $DBcon->prepare("select * from subjno where (classlevel =:kls and term =:tm) and yr =:y ") ; $sqlm->bindparam(':kls',$level) ; $sqlm->bindparam(':tm',$term) ; $sqlm->bindparam(':y',$schyear) ; $sqlm->execute() ; $rowm = $sqlm->FETCH(PDO::FETCH_ASSOC) ; $min = $rowm['nos'] ; if($num_rows < $min) $average = $count / $min ; else */ $average = $count / $num_rows ; if ($average >= 80) { $comment = "Pass, Excellent performance! Shows exceptional understanding of all subjects. Keep it up!"; } elseif ($average >= 70) { $comment = "Pass, Very good performance. Shows strong grasp of most concepts. Continue the good work."; } elseif ($average >= 60) { $comment = "Pass, Good performance. Shows satisfactory understanding. Room for improvement in some areas."; } elseif ($average >= 50) { $comment = "Pass, Average performance. Needs to work harder and be more consistent in studies."; } elseif ($average >= 49.99) { $comment = "Pass, Below average. Requires extra help and regular practice to improve."; } else { $comment = "Fail, Unsatisfactory performance. Immediate intervention required. Extra classes recommended."; } //additional comment /* $pml = count($psubj); for($x = 0; $x < $pml; $x++) { if($psubj[$x] == 'ENGLISH LANGUAGE') { $engscore = $pscore[$x] ; } if($psubj[$x] == 'MATHEMATICS') { $mathscore = $pscore[$x] ; } if($psubj[$x] == 'C.R.S.') { $moralscore = $pscore[$x] ; } } if($average > 40) { if(($engscore < 55) or ($mathscore < 55) or ($moralscore < 55)) { $adcmt = ' FAILED , you failed to obtain at least C grade in either English , Maths or CRS' ; } else { $adcmt = 'PASS, Work harder' ; } } else { $adcmt = 'FAILED , Sit up next term' ; } */ // end of additional comment ?>
SUBJECTS TEST EXAM TOTAL POSITION GRADE REMARK
" . $mysubj . "" . $row['test'] . "" . $row['midterm'] . "" . $row['exam'] . "" . $total . "" . $spm . "" . $grade . "" . $rmk . "
 
Key to Grades : A : 75 - 100, B: 70 - 74.99, C : 55 - 69.99 , P : 49 - 54.99 , F : 0 - 48.99

Total Score:    ,   Average:    ,   Position:    prepare("select * from marks where (klass = :kls and acyear = :yr) and (regno = :reg and term =:tm) ") ; $so->bindparam(':kls' , $classid) ; $so->bindparam(':yr' , $schyear) ; $so->bindparam(':reg' , $regno) ; $so->bindparam(':tm' , $term) ; $so->execute() ; //$res = mysql_query($so) or die('Error: ' . mysql_error()) ; while ($ro = $so->FETCH(PDO::FETCH_ASSOC)) { $fst = $ro['test'] ; //$sc = $ro['midterm'] ; $exa = $ro['exam'] ; $tom = $fst + $exa ; $maya[] = $tom ; } $cal = array_sum($maya) ; //start $streamno = array(); $arresult = array() ; $myarray = array() ; //$finarray = array() ; $sqla = $DBcon->prepare("select distinct regno from marks where (klass =:kls and acyear =:yr) and term = :tm" ) ; $sqla->bindparam(':kls',$classid) ; $sqla->bindparam(':yr',$schyear) ; $sqla->bindparam(':tm',$term) ; $sqla->execute() ; //$exec = mysql_query($sqla) or die('Error: ' . mysql_error()); //$row = mysql_fetch_array($exec) ; while ($streamrow = $sqla->FETCH(PDO::FETCH_ASSOC)) { $streamno[] = $streamrow['regno']; } foreach ($streamno as $val) { $sqlgo =$DBcon->prepare("select * from marks where ((regno = :v and klass = :kls) and (term =:tm and acyear = :yr)) ") ; $sqlgo->bindparam(':v',$val) ; $sqlgo->bindparam(':kls',$classid) ; $sqlgo->bindparam(':tm',$term) ; $sqlgo->bindparam(':yr',$schyear) ; $sqlgo->execute() ; //$go = mysql_query($sqlgo) or die('Error: ' . mysql_error()); //$gorow = mysql_fetch_array($go) ; $rownumber = $sqlgo->rowcount() ; while ($gorow = $sqlgo->FETCH(PDO::FETCH_ASSOC)) { $first = $gorow['test'] ; //$sec = $gorow['midterm'] ; $ex = $gorow['exam'] ; $tota = $first + $ex ; $myarray[] = $tota ; //$myarray[] = $ar ; } $tosum = array_sum($myarray) ; $ar = $tosum/$rownumber; $arresult[] = $ar ; $myarray = array() ; } arsort($arresult) ; $ps = 0 ; foreach($arresult as $tot) { $ps++ ; $app = position($ps) ; if($average == $tot) { echo $ps.$app ; break ; } } $count = 0 ; $average = 0 ; ?> :   Out of:  

prepare("select * from marks where (level = :kls and acad_session = :yr) and (stregno = :reg and term =:tm) ") ; $so1->bindparam(':kls' , $lev) ; $so1->bindparam(':yr' , $schyear) ; $so1->bindparam(':reg' , $regno) ; $so1->bindparam(':tm' , $term) ; $so1->execute() ; //$res = mysql_query($so) or die('Error: ' . mysql_error()) ; $rnb = $so1->rowcount() ; while ($ro1 = $so1->FETCH(PDO::FETCH_ASSOC)) { //variables //$maya1 = array() ; //$arresult1 = array() ; $fst = $ro1['test'] ; $sc = $ro1['midterm'] ; $exa = $ro1['exam'] ; $tom1 = $fst + $exa + $sc ; $maya1[] = $tom1 ; } $cal1 = array_sum($maya1) ; if($rnb < $min) $arv = $cal1/$min ; else $arv = $cal1/$rnb; $arresult1[] = $arv ; //start //$finarray = array() ; $sqla1 = $DBcon->prepare("select distinct stregno from marks where (level =:kls and acad_session =:yr) and term = :tm" ) ; $sqla1->bindparam(':kls',$lev) ; $sqla1->bindparam(':yr',$schyear) ; $sqla1->bindparam(':tm',$term) ; $sqla1->execute() ; //$exec = mysql_query($sqla) or die('Error: ' . mysql_error()); //$row = mysql_fetch_array($exec) ; $rc = $sqla1->rowcount() ; while ($streamrow1 = $sqla1->FETCH(PDO::FETCH_ASSOC)) { $streamno1[] = $streamrow1['stregno']; } foreach ($streamno1 as $val) { $sqlgo1 =$DBcon->prepare("select * from marks where ((stregno = :v and level = :kls) and (term =:tm and acad_session = :yr)) ") ; $sqlgo1->bindparam(':v',$val) ; $sqlgo1->bindparam(':kls',$lev) ; $sqlgo1->bindparam(':tm',$term) ; $sqlgo1->bindparam(':yr',$schyear) ; $sqlgo1->execute() ; //$go = mysql_query($sqlgo) or die('Error: ' . mysql_error()); //$gorow = mysql_fetch_array($go) ; $rownumber1 = $sqlgo1->rowcount() ; while ($gorow1 = $sqlgo1->FETCH(PDO::FETCH_ASSOC)) { $first = $gorow1['test'] ; $sec = $gorow1['midterm'] ; $ex = $gorow1['exam'] ; $tota1 = $first + $ex + $sec ; $myarray1[] = $tota1 ; //$myarray[] = $ar ; } $tosum1 = array_sum($myarray1) ; if($rownumber1 < $min) $ar1 = $tosum1/$min ; else $ar1= $tosum1/$rownumber1; $arresult1[] = $ar1 ; $myarray1 = array() ; } arsort($arresult1) ; $ps1 = 0 ; foreach($arresult1 as $tot) { $ps1++ ; $app = position($ps1) ; if($arv == $tot) { echo $ps1.$app ; break ; } } $cal1 = 0 ; $arv = 0 ; $arv1 = 0 ; $tosum1 = 0 ; } */ ?>

Principal Remarks::
Rev. SR. IFENNAMAKA OKAFOR (Management)
Next Term Resumes::
Next Term Fees:
SCHOOL FEES ACCOUNT: